package com.example.safehome;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import androidx.appcompat.app.AppCompatActivity;

public class SubSystemsChoosingActivity extends AppCompatActivity {

    ImageButton toSystem;
    ImageButton toSensor;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sub_system_choice);

        // 跳转到System的按钮事件
        toSystem = (ImageButton) findViewById(R.id.to_system);
        toSystem.setOnClickListener(new View.OnClickListener() {
           public void onClick(View view) {
               Intent intent = new Intent(SubSystemsChoosingActivity.this, SystemActivity.class);
               startActivity(intent);
               finish();
           }
        });

        // 跳转到Sensor的按钮事件
        toSensor = (ImageButton) findViewById(R.id.to_sensor);
        toSensor.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent intent = new Intent(SubSystemsChoosingActivity.this, SensorChoosingActivity.class);
                startActivity(intent);
                finish();
            }
        });
    }
}
